CREATE TABLE `SRTheo`.`MsgSRTheoExpSurface` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`theoModel` VARCHAR(16) NOT NULL DEFAULT '',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'client firm this theo model is associated with (controls visibility)',
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '',
`skewFunc` ENUM('None','ICurve','SRDynCurve','TheoSpline','SVI') NOT NULL DEFAULT 'None',
`volTimeUnits` ENUM('Default','V6') NOT NULL DEFAULT 'Default' COMMENT 'default uses the SR native time metric (trading minutes); V6 is a prior SR metric (trading days)',
`uPrcRefRule` ENUM('NbboMid','NbboCross') NOT NULL DEFAULT 'NbboMid',
`refUPrc` FLOAT NOT NULL DEFAULT -1 COMMENT '-1 = use SR uPrc @ record insert',
`refUPrcWeight` FLOAT NOT NULL DEFAULT 0 COMMENT 'w: [0,1];adjRefUPrc = w * refUPrc + (1 - w) * uPrc;note: w=1 implies sticky strike behavior;w=0 implies sticky delta behavior',
`refSRAtm` FLOAT NOT NULL DEFAULT -1 COMMENT '-1 = use SR surface atm @ record insert',
`refSRAtmWeight` FLOAT NOT NULL DEFAULT 0 COMMENT 'w: [0,1];theoVolAdj = theoVol + tvSlope * (uPrc - refUPrc) + w * (liveSRAtm - refSRAtm)',
`paramA` FLOAT NOT NULL DEFAULT 0 COMMENT 'param A - J are inputs to the skewFunc model selected above',
`paramB` FLOAT NOT NULL DEFAULT 0,
`paramC` FLOAT NOT NULL DEFAULT 0,
`paramD` FLOAT NOT NULL DEFAULT 0,
`paramE` FLOAT NOT NULL DEFAULT 0,
`paramF` FLOAT NOT NULL DEFAULT 0,
`paramG` FLOAT NOT NULL DEFAULT 0,
`paramH` FLOAT NOT NULL DEFAULT 0,
`paramI` FLOAT NOT NULL DEFAULT 0,
`paramJ` FLOAT NOT NULL DEFAULT 0,
`theoVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'theo volatility @ hypothetical atm strike (note: hypothetical atm strike depends on the definition of xAxis implied by the skewFunc model;usually the strike where xAxis = 0)',
`bOpnVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'buy open vol',
`bClsVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'buy close vol',
`sOpnVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'sell open vol',
`sClsVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'sell close vol',
`bOpnEdge` FLOAT NOT NULL DEFAULT 0 COMMENT 'edge spread to open when buying',
`bClsEdge` FLOAT NOT NULL DEFAULT 0 COMMENT 'edge spread to close when buying',
`sOpnEdge` FLOAT NOT NULL DEFAULT 0 COMMENT 'edge spread to open when selling',
`sClsEdge` FLOAT NOT NULL DEFAULT 0 COMMENT 'edge spread to close when selling',
`buySellConvention` ENUM('None','Minimum','BSSpread','BSPctSprd','BSOffsetPts','BSOffsetPct') NOT NULL DEFAULT 'None',
`lnDDiv` FLOAT NOT NULL DEFAULT -99 COMMENT '(depricated)',
`shDDiv` FLOAT NOT NULL DEFAULT -99 COMMENT '(depricated)',
`lnSDiv` FLOAT NOT NULL DEFAULT -99 COMMENT 'long sdiv',
`shSDiv` FLOAT NOT NULL DEFAULT -99 COMMENT 'short sdiv',
`tvSlope` FLOAT NOT NULL DEFAULT 0 COMMENT 'tvSlope = dTheoVol / dUPrc;theoVolAdj = theoVol + tvSlope * (uPrc - refUPrc). Note: tvSlope affects the calculation of theoSurface veSlope values which in turn affect hedgeDelta calculations when account.hedgeType = ''TvS''',
`divRule` ENUM('UseSRImplied','SDivValue','SDivOffset','MinMaxValue') NOT NULL DEFAULT 'UseSRImplied' COMMENT 'specifies how DDiv and SDiv values will be incorporated',
`userRateOverride` ENUM('None','Yes','No') NOT NULL DEFAULT 'No' COMMENT 'use rate from the UserRateOverride table instead of SR Rate curve',
`userSDivOverride` ENUM('None','Yes','No') NOT NULL DEFAULT 'No' COMMENT 'use sdiv from the UserSDivOverride table instead of SR SDiv',
`userDDivOverride` ENUM('None','Yes','No') NOT NULL DEFAULT 'No' COMMENT 'use dividends from the UserDividendOverride table instead of SR Dividends',
`minUBid` FLOAT NOT NULL DEFAULT 0 COMMENT 'any non-hold status will revert to markup if live uMid is outside of [minUBid, maxUAsk]',
`maxUAsk` FLOAT NOT NULL DEFAULT 0,
`theoStatus` ENUM('Hold','Auto','Scanner','Markup','CloseOnly') NOT NULL DEFAULT 'Hold',
`comment` VARCHAR(16) NOT NULL DEFAULT '',
`updated` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'datetime of last record update. will default to current datetime on record load of not supplied',
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'user who last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'timestamp of last modification',
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`,`theoModel`,`clientFirm`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='SpdrTheoExpSurface records reprent a client theoretical volatility surface for a ExpiryKey (ticker + expiration). These records can either directly specify parameters to be used in a parameterized surface function or can link to a record (eg. SpdrTheoExp2PtCurve) containing x/y points sampling a client constructed curve. Alternatively, they can specify that a SpiderRock implied skew curve should be used along with client supplied atm volatilities.\nSurface dynamics can be specified in multiple ways with these records and a number of pricing parameter overrides are also available.\nSee the technical note on client supplied theoretical surfaces for more details.';